#include "List.h"
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	List* list = create_list();
	if (!list) {
		printf("Error: create_list failed in main.\n");
		exit(1);
	}

	//add_before_head(list, 1);
	//add_before_head(list, 2);
	//add_before_head(list, 3);
	//add_before_head(list, 4); // 4-->3-->2-->1

	add_behind_tail(list, '1');
	add_behind_tail(list, '2');
	add_behind_tail(list, '3');
	add_behind_tail(list, '4');	// 1-->2-->3-->4

	add_node(list, 0, 'A');
	add_node(list, 5, 'B');
	add_node(list, 3, 'C');		// A -> 1 --> 2 --> C --> 3 --> 4 --> B

	// Node* node = find_by_index(list, 3);
	// Node* node = find_by_index(list, 100);

	// Node* node = search_for_value(list, '4');
	// Node* node = search_for_value(list, 'X');

	delete_node(list, 'C');
	delete_node(list, 'A');
	delete_node(list, 'B');
	delete_node(list, 'X');

	return 0;
}